throwStruct

A mock struct that always throws.

throwStruct
(
E = from!"unit_threaded.should".UnitTestException
R = void
)
(
)

Examples

1 import std.exception : assertThrown;
2 import unit_threaded.should : UnitTestException;
3 
4 auto m = throwStruct;
5 assertThrown!UnitTestException(m.foo);
6 assertThrown!UnitTestException(m.bar(1, "foo"));

Meta